<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.infodms.dms.common.Constant"%>
<%@ page import="java.util.List"%>
<%@taglib uri="/jstl/cout" prefix="c"%>
<%
	String contextPath = request.getContextPath();
	List entityList = (List)request.getAttribute("entityList") ;
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<jsp:include page="${contextPath}/common/jsp_head_new.jsp" />
<script type="text/javascript">
	function doInit(){
		//__extQuery__(1);
		//loadcalendar();   
	}
	function txtClr(valueId) {
		document.getElementById(valueId).value = '' ;
	}
</script>
<title>实销退车审核</title>
</head>
<body onunload='javascript:destoryPrototype();'> 
<div class="wbox">
	<div class="navigation"><img src="<%=contextPath%>/img/nav.gif" />&nbsp;当前位置： 整车销售 > 实销信息管理 > 实销退车审核</div>
	<form id="fm" name="fm" method="post">
		<input type="hidden" name="curPage" id="curPage" value="1" />
		<input type="hidden" id="dlrId" name="dlrId" value="" />
		<table class="table_query" border="0">
		<tr>
				<td width="20%" class="tblopt"><div align="right">VIN：</div></td>
				<td  width="20%" >
      				<textarea name="vin" cols="18" rows="3" ></textarea>
    			</td>
    			<td  width="10%"  align="right">选择基地：</td>
		      	<td   width="20%"   align="left">
		      		<select name="entity" id="entity" class="short_sel">
		      			<option value="">--请选择--</option>
			      		<c:forEach var="entityList" items="${entityList }">
			      			<option value="${entityList.PRODUCE_BASE }">${entityList.CODE_DESC }</option>
			      		</c:forEach>
			      	</select>
				</td>
    			 <!--<td  width="10%"  align="right">选择业务范围：</td>
		      	<td   width="20%"   align="left">
					<select name="areaId" class="short_sel">
					<c:forEach items="${areaList}" var="po">
						<option value="${po.AREA_ID}">${po.AREA_NAME}</option>
					</c:forEach>
				</select>
				</td>
    			--><td colspan="2" align="left"  width="30%"  >选择经销商：
    			<input type="text" class="middle_txt" name="dealerCode" id="dealerCode" size="15" value=""/>
    			<input name="button2" type="button" class="mini_btn" onclick="showOrgDealer('dealerCode', '', 'true', '', 'true');" value="..." />
    			<input type="button" class="normal_btn" onclick="txtClr('dealerCode');" value="清 空" id="clrBtn" />
    			</td>
		</tr>
		<tr>
				<td width="20%" class="tblopt"><div align="right"></div></td>
				<td colspan="4">
				</td>
				<td class="table_query_3Col_input" >
					<input type="button" class="normal_btn" onclick="__extQuery__(1)" value="查 询" id="queryBtn" /> 
					<input type="hidden" id="vehicle_id" value="" />
					<input type="hidden" id="return_id" value="" />
				</td>
		</tr>
		</table>
		<jsp:include page="${contextPath}/queryPage/orderHidden.html" />
	</form>
	<jsp:include page="${contextPath}/queryPage/pageDiv.html" />
</div>
<script type="text/javascript" ><!--
	var myPage;
	
	var url = "<%=contextPath%>/sales/customerInfoManage/SalesVehicleReturn/queryToReturnVehicleList.json?COMMAND=1";
	
	var title = null;
	var columns = [
				{header: "车系代码", dataIndex: 'SERIES_CODE', align:'center'},
				{header: "车系名称", dataIndex: 'SERIES_NAME', align:'center'},
				{header: "车型代码", dataIndex: 'MODEL_CODE', align:'center'},
				{header: "车型名称", dataIndex: 'MODEL_NAME', align:'center'},
				{header: "VIN", dataIndex: 'VIN', align:'center'},
				{header: "所属经销商", dataIndex: 'DEALER_SHORTNAME', align:'center'},
				{header: "实销时间", dataIndex: 'SALES_DATE', align:'center'},
				{header: "退车申请时间", dataIndex: 'REQ_DATE', align:'center'},
				{id:'action',header: "操作", walign:'center',idth:70,sortable: false,dataIndex: 'ORDER_ID',renderer:myLink}
		      ];
		      
	function myLink(value,metaDate,record){
		var data = record.data;
		var vehicleId = data.VEHICLE_ID ;
		var returnId = data.RETURN_ID ;
        return String.format(
        		 "<a id=\"chk\" href=\"#\" onclick=\"chkSales(" + vehicleId + ", " + returnId + ");\">[审核]</a>");
    }

    function chkSales(vId, rId) {
		document.getElementById('vehicle_id').value = vId ;
		document.getElementById('return_id').value = rId ;
		// var areaId = document.getElementById("areaId").value;
		var entity = document.getElementById("entity").value;
		fm.action = "<%=contextPath%>/sales/customerInfoManage/SalesVehicleReturn/toCheckReturnVehicle.do?vehicle_id=" + vId + "&return_id=" + rId + "&entity="+entity ;
		fm.submit() ;
    }
	    
 --></script>    
</body>
</html>